<!-- 用户具体信息显示 -->
<template>
  <div id="user-info">
    <nav-bar class="navbar">
      <template v-slot:left>
        <img src="~assets/img/navbar/left_arrow.svg" @click="loginOut" />
      </template>
      <template v-slot:center>
        <h3>个人信息</h3>
      </template>
    </nav-bar>

    <info-slot>
      <template v-slot:name>头像</template>
      <template v-slot:content1>
        <div class="content1">
          <img src="~assets/img/profile/userDefault.jpg" alt="" />
        </div>
      </template>
      <template v-slot:content2></template>
    </info-slot>

    <info-slot>
      <template v-slot:name>昵称</template>
      <template v-slot:content1
        ><dir class="content1-text">宠友06877</dir></template
      >
      <template v-slot:content2></template>
    </info-slot>

    <info-slot>
      <template v-slot:name>性别</template>
      <template v-slot:content1><dir class="content1-text">男</dir></template>
      <template v-slot:content2></template>
    </info-slot>

    <info-slot>
      <template v-slot:name>所在城市</template>
      <template v-slot:content1><dir class="content1-text"></dir></template>
      <template v-slot:content2></template>
    </info-slot>

    <div class="submit">
      <button type="button">保存</button>
    </div>
  </div>
</template>

<script>
import NavBar from "common/navbar/NavBar.vue";
import InfoSlot from "../InfoSlot.vue";

export default {
  name: "UserInfo",
  components: {
    NavBar,
    InfoSlot,
  },
  data() {
    return {
      profile: {
        photo: "tx",
        nama: "name",
        gender: "男",
        city: "",
      },
    };
  },
  //生命周期 - 创建完成（访问当前this实例）
  created() {},
  methods: {
    loginOut() {
      this.$emit("loginOut");
    },
  },
  //生命周期 - 挂载完成（访问DOM元素）
  mounted() {},
};
</script>

<style scoped>
#user-info {
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background-color: #fff;
  z-index: 100;
}
.navbar img {
  width: 25px;
  height: 25px;
}
.navbar h3 {
  text-align: center;
}
.info-slot::after {
  border: 0;
}
.content1 {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background-color: #ccc;
  overflow: hidden;
  color: #ccc;
}
.content1 img {
  width: 100%;
}
.submit{
  position: fixed;
  bottom: 50px;
  width: 100%;
}
.submit button{
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  background-image: linear-gradient(to right, #ff8b12, #fe5d05);
  width: 90%;
  padding: 15px 0;
  border-radius: 40px;
  box-shadow: 0 3px 3px rgba(100,100,100,.4);
  color: #fff;
  font-size: 17px;
}
</style>